<!--header-->
<!--# include virtual="/ceca_two/common/html/header.html"-->
<link rel="stylesheet" href="/ceca_two/css/costShareOne.css" />
<link rel="stylesheet" href="/ceca_two/css/shareSubmit.css" />
<style>
	.prevBtn{
		float: left;
		height: 45px;
		width: 105px;
		background: #ff3030;
		font-size: 16px;
		line-height: 45px;
		text-align: center;
		margin: 50px 20px 50px 440px;
	}
	.prevBtn a{
		color: #fff;
	}
	.proText{
		width: 35px;
		overflow: hidden;
		display: inline-block;
	}
	.submitImg .ImgList .thumbnail .info{
		width: 100%;
		text-align: center;
		display: block;
		line-height: 30px;
	}
</style>
<script type="text/javascript">
	var annexFile = new Array();
	var annexPhoto = new Array();
	var annexSpace = new Array();
	var annexSystem = new Array();
	var annexStereogram = new Array();
</script>
<div class="content">
	<ul class="shareList">
		<li>当前位置：</li>
		<li><a href="##">首页</a></li>
		<li>&gt;</li>
		<li><a href="##">我要分享</a></li>
	</ul>
	<div class="shareSuccess">
		<div class="selfMotion">
			自动保存成功
		</div>
		<h1 class="costShare">造价指标分享</h1>
	</div>
	<div class="shareText">
		<ul class="shareMessage">
			<li>分享人：<span>在线</span></li>
			<li>分享人单位：<span>中国工程造价协会</span></li>
		</ul>
		<h1 class="shareName">附件</h1>
	</div>
	<!--# include virtual="/ceca_two/modules/share/base/fileUoload.html"-->
	<!--# include virtual="/ceca_two/modules/share/base/sharePhoto.html"-->
	<!--# include virtual="/ceca_two/modules/share/base/spacePhoto.html"-->
	<!--# include virtual="/ceca_two/modules/share/base/systemPhoto.html"-->
	<!--# include virtual="/ceca_two/modules/share/base/stereogramPhoto.html"-->

	<div class="shareCostBtn">
		<div class="prevBtn">
			<a href="javascript:;">上一步</a>
		</div>
		<div class="nextBtn">
			<button>提交</button>
		</div>
	</div>
</div>
<!--底部-->
<!--# include virtual="/ceca_two/common/html/footer.html"-->
<script type="text/javascript">
layui.use(['costshareOne','sharesubmit','layer'], function() {
		
	var costId = GetQueryString("costId");
	var catalogId = GetQueryString("catalogId");
	
	function GetQueryString(name){
	     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
	     var r = window.location.search.substr(1).match(reg);
	     if(r!=null)return  unescape(r[2]); return null;
	}
	var layer = layui.layer;

	$(".prevBtn").on("click",function () {
        window.history.back(-1);
    });

	$(".nextBtn button").click(function(){
	    var annex = {"annexFile":annexFile,
                "annexPhoto":annexPhoto,
                "annexSpace":annexSpace,
                "annexSystem":annexSystem,
                "annexStereogram":annexStereogram
            };
	    var updataCondition = false;
        $.each(annex, function(index, value, array) {
            if( value.length < 1 ){
                updataCondition = false;
                return false;
            }else{
                updataCondition = true;
			}
        });
        if( updataCondition ){
            $.ajax({
                type:"post",
                url:"/guidance_service/front/data/update.do",
                data:{
                    costId : costId,
                    annex: JSON.stringify(annex)
                },
                success:function (result){

                    if( result.resultCode == 200 ){

                        sessionStorage.removeItem("cecaCostId");
                        sessionStorage.removeItem("civilOne");
                        sessionStorage.removeItem("industryOne");

                        layer.open({
                            type:1,
                            content:'<img src="/ceca_two/img/tch_icon.png"/><h1>提交成功 </h1><p>感谢您的分享，若您的指标被收录，您将会收到一份有关指标分析的报告。</p>',
                            area:['405px','235px'],
                            offset:'200px',
                            btn:'关闭',
                            btn1: function(index, layero){
                                window.location.href="/ceca_two/modules/share/index.html";
                            }
                        });
                    }else{
                        layer.msg("请求错误！请稍候重试",{icon:2,time:3000});
					}
                },error:function (){
                    layer.msg("请求错误！请稍候重试",{icon:2,time:3000});
                }
            });
        }else{
            layer.msg("请您上传完文件之后再进行提交",{icon:2,time:3000});
		}
	});
});
</script>
</body>
</html>